package com.wc.alorithm_blue_bridge.线段树.GCD不小于K的子数组;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/3/18 8:28
 * @description
 * https://www.lanqiao.cn/courses/46292/learning/?id=3440218&compatibility=false
 */
public class Main {
    /**
     * 思路：
     * 双指针 + 线段树维护区间gcd
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 200010, M = N << 2;
    static int[] t = new int[M], a = new int[N];
    static int n, m;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        build(1, 1, n);
        int l = 1, r = 1;
        long res = 0;
        while (l <= n) {
            if (r <= n && query(1, 1, n, l, r) >= m) r++;
            else {
                // 计算答案
                res += r - l;
                l++;
                // 确保长度至少为一个
                if (l > r) r++;
            }
        }
        out.println(res);
        out.flush();
    }

    static void build(int u, int l, int r) {
        if (l == r) {
            t[u] = a[l];
            return;
        }
        int mid = l + r >> 1;
        build(u << 1, l, mid);
        build(u << 1 | 1, mid + 1, r);
        pushUp(u);
    }

    static void pushUp(int u) {
        t[u] = gcd(t[u << 1], t[u << 1 | 1]);
    }

    static int gcd(int a, int b) {
        return b > 0 ? gcd(b, a % b) : a;
    }

    static int query(int u, int l, int r, int ql, int qr) {
        if (l == ql && r == qr) return t[u];
        int mid = l + r >> 1;
        if (qr <= mid) return query(u << 1, l, mid, ql, qr);
        if (ql > mid) return query(u << 1 | 1, mid + 1, r, ql, qr);
        int L = query(u << 1, l, mid, ql, mid);
        int R = query(u << 1 | 1, mid + 1, r, mid + 1, qr);
        return gcd(L, R);
    }

}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

